<?php if (!defined('THINK_PATH')) exit();?><form id="pagerForm" method="post" action="">
	<input type="hidden" name="pageNum" value="<?php echo ($pageNum); ?>" />
	<input type="hidden" name="numPerPage" value="<?php echo ($numPerPage); ?>" />
	<input type="hidden" name="orderField" value="<?php echo ($orderField); ?>" />
	<input type="hidden" name="orderDirection" value="<?php echo ($orderDirection); ?>" />
	<input type="hidden" name="keywords" value="<?php echo ($keywords); ?>" />
	<input type="hidden" name="sfield" value="<?php echo ($sfield); ?>" />
	<input type="hidden" name="platform" value="91YUNGOU" />
</form>

<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="" method="post">
		<input type="hidden" name="m" value="<?php echo ($module_name); ?>" />
		<input type="hidden" name="a" value="<?php echo ($action_name); ?>" />
	<div class="searchBar">
		<ul class="searchContent">
			<li style="width:210px;">
				<label style="width:60px;">关键字：</label>
				<input type="text" name="keywords" value="<?php echo ($keywords); ?>" style="width:120px;"/>
			</li>
			<li style="width:60px;">
			<select name="sfield" class="combox">
				<option value="all" <?php if($sfied=='all') : ?>selected="selected"<?php endif;?>>全部</option>
				<option value="username" <?php if($sfied=='username') : ?>selected="selected"<?php endif;?>>用户名</option>
				<option value="id" <?php if($sfied=='id') : ?>selected="selected"<?php endif;?>>ID</option>
				<option value="sn" <?php if($sfied=='sn') : ?>selected="selected"<?php endif;?>>订单编号</option>
			</select>
			<input type="hidden" name="sfield_name" value="id,userid,sn" />
			</li>
			<li>
				<select name="sel_status">
					<option value="ALL" <?php if($sel_status=='ALL'||empty($sel_status)) : ?>selected="selected"<?php endif;?>>全部订单状态</option>
<?php if(is_array($status)): $i = 0; $__LIST__ = $status;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$st): $mod = ($i % 2 );++$i;?><option value="<?php echo ($key); ?>" <?php if($sel_status==(string)$key) : ?>selected="selected"<?php endif;?>><?php echo ($st); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>					
				</select>
			</li>
			<div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div>
		</ul>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="<?php echo U('Order/add_msg');?>&id={sid_dv}" target="dialog" width="580" height="350" rel="User_add" warn="请选择一个笔订单"><span>添加备注</span></a></li>
			<li><a class="edit" href="<?php echo U('Order/show_msg');?>&id={sid_dv}" target="dialog" width="580" height="350" warn="请选择一个笔订单"><span>查看备注</span></a></li>
			<li><a class="icon" href="javascript:$.printBox('w_list_print')"><span>打印</span></a></li>
			<li><a class="icon" target="selectedTodo" rel="ids[]" href="<?php echo U('Order/add_depot');?>" title="备货" warn="请选择一个笔订单"><span>备货</span></a></li>
			<li><a class="icon selectedDo"  target="_blank" rel="ids[]" href="<?php echo U('Print/o2o_print');?>" title="打印出库单" warn="请选择一个笔订单"><span>打印出库单</span></a></li>
			<li><a class="icon selectedDo" target="_blank" rel="ids[]" href="<?php echo U('Print/o2o_psdprint');?>" title="打印快递单" warn="请选择一个笔订单"><span>打印快递单</span></a></li>
			<li><a class="icon selectedDo" rel="Order_add_depot" target="dialog" data="ids[]" href="<?php echo U('Order/add_depot');?>" title="备货" warn="请选择一个笔订单"><span>备货</span></a></li>
		</ul>
	</div>
	<div id="w_list_print">
	<table class="list" width="98%" targetType="navTab" layoutH="96">
		<thead>
			<tr>
				<th width="22"></th>
				<th colspan="4" align="center">基本信息</th>
				<th colspan="2" align="center">商户信息</th>
				<th colspan="4" align="center">客户信息</th>
				<th colspan="5" align="center">操作进度</th>
			</tr>
			<tr>
				<th width="22"><input type="checkbox" group="ids[]" class="checkboxCtrl"></th>
				<th width="60" orderField="id" <?php if($orderField=='id') : ?>class="<?php echo ($orderDirection); ?>"<?php endif;?>>编号</th>
				<th width="100" orderField="sn" <?php if($orderField=='sn') : ?>class="<?php echo ($orderDirection); ?>"<?php endif;?>>SN</th>
				<th width="150" orderField="add_time" <?php if($orderField=='add_time') : ?>class="<?php echo ($orderDirection); ?>"<?php endif;?>>创建时间</th>
				<th width="150" orderField="mtime" <?php if($orderField=='mtime') : ?>class="<?php echo ($orderDirection); ?>"<?php endif;?>>更新时间</th>
				<th width="80" orderField="userid" <?php if($orderField=='userid') : ?>class="<?php echo ($orderDirection); ?>"<?php endif;?>>云购商</th>
				<!-- <th width="80">委托</th>
				<th width="80">转交</th> -->
				<th width="80" orderField="amount" <?php if($orderField=='amount') : ?>class="<?php echo ($orderDirection); ?>"<?php endif;?>>金额</th>
				<th width="80">销售金额</th>
				<th width="150">支付</th>
				<th width="50">发票</th>
				<th width="50">配送</th>
				<th width="50" orderField="status" <?php if($orderField=='status') : ?>class="<?php echo ($orderDirection); ?>"<?php endif;?>>状态</th>
				<!-- <th width="80" orderField="status" <?php if($orderField=='status') : ?>class="<?php echo ($orderDirection); ?>"<?php endif;?>>支付</th> -->
				<th width="50" orderField="status" <?php if($orderField=='status') : ?>class="<?php echo ($orderDirection); ?>"<?php endif;?>>配送</th>
				<th width="200">操作</th>
			</tr>
		</thead>
		<tbody>
<?php if($totalCount==0) : ?>
		<tr>
			<td colspan="13" align="center">暂无相关信息</td>
		</tr>
<?php else :?>
<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr target="sid_dv" rel="<?php echo ($vo['id']); ?>">
				<td><input name="ids[]" value="<?php echo ($vo['id']); ?>" type="checkbox"></td>
				<td><?php echo ($vo['id']); ?></td>
				<td><a title="查看" target="dialog" width="800" height="650" rel="Order_detailo2o_<?php echo ($vo['id']); ?>" href="<?php echo U('Order/detailo2o',array('id'=>$vo['id']));?>"><?php echo ($vo['sn']); ?></a></td>
				<td><?php if(empty($vo['add_time'])) : ?>-<?php else : echo (date("Y-m-d H:i:s",$vo['add_time'])); endif;?></td>
				<td><?php if(empty($vo['mtime'])) : ?>-<?php else : echo (date("Y-m-d H:i:s",$vo['mtime'])); endif;?></td>
				<td><?php if(empty($vo['userid'])) : ?>未受理<?php else : echo ($vo['userid']); endif;?></td>
				<!-- <td><?php if($vo['pay_status']==0) : ?>-<?php elseif($vo['pay_status']==2): ?>已委托<?php endif;?></td>
				<td><?php if($vo['ext']['move']['value']==1) : ?>已转交<?php elseif($vo['pay_status']==2): ?>-<?php endif;?></td> -->
				<td><?php echo (number_format($vo['amount']/100,2,'.','')); ?></td>
				<td><?php echo (number_format($vo['ext']['amount']['value']/100,2,'.','')); ?></td>
				<td><?php if($vo['ext']['pay']['value']==1) : ?>在线支付<?php else :?>门店支付<?php endif;?> <?php if($vo['ext']['pay_status']['value']==0) : ?>未支付<?php elseif($vo['ext']['pay_status']['value']==2): ?>已支付<?php endif;?></td>
				<td><?php if($vo['ext']['isfapiao']['value']==1) : ?>是<?php else :?>否<?php endif;?></td>
				<td><?php if($vo['ext']['kdps']['value']==1) : ?>门店<?php else :?>快递<?php endif;?></td>
				<td><?php echo ($status[$vo['status']]); ?></td>
				<!-- <td><?php echo ($pay_status[$vo['pay_status']]); ?></td> -->
				 <td><?php echo ($shipping_status[$vo['shipping_status']]); ?></td>
				<td>
					<a title="<?php echo ($vo['sn']); ?> 查看" target="dialog" width="800" height="650" rel="Order_detailo2o_<?php echo ($vo['id']); ?>" href="<?php echo U('Order/detailo2o',array('id'=>$vo['id']));?>" class="btnInfo">查看</a>
					<?php if($vo['status']!=-10) : ?>
						<?php if((!empty($vo['userid'])&&$vo['pay_status']==2)||$vo['ext']['move']['value']==1) : ?>
							<a title="<?php echo ($vo['sn']); ?>标记缺货" target="dialog" width="680" height="350" rel="Order_oos_<?php echo ($vo['id']); ?>" href="<?php echo U('Order/oos',array('id'=>$vo['id']));?>" class="btnEdit">标记缺货</a>
							
							<a title="<?php if($vo['status']==0) : ?>确认订单<?php else :?>订单已经确认<?php endif;?>" target="ajaxTodo" href="<?php echo U('Order/status',array('id'=>$vo['id'],'status'=>'1'));?>" <?php if($vo['status']==0) : ?>class="btnqr"<?php else :?>class="btnyqr"<?php endif;?>>确认</a>
							
							<a title="<?php echo ($vo['sn']); ?> 发货" target="dialog" width="500" height="200" rel="Order_sipping_<?php echo ($vo['id']); ?>" href="<?php echo U('Order/sipping',array('id'=>$vo['id']));?>" class="btnfh">发货</a>
							
							<a target="_blank" href="<?php echo U('Print/o2o_print',array('id'=>$vo['id']));?>" title="打印出库单" class="btndy" >出库</a>
							
							<a target="_blank" href="<?php echo U('Print/o2o_psdprint',array('id'=>$vo['id']));?>" title="打印快递单" class="btndy" >快递</a>
						<?php endif;?>
					<a title="<?php echo ($vo['sn']); ?> 订单询价" target="navTab" rel="Order_suppliers_<?php echo ($vo['id']); ?>" href="<?php echo U('Order/suppliers',array('ids'=>$vo['id']));?>" class="btnLook">订单询价</a>
					<a title="<?php if($vo['status']!=-10) : ?>订单取消<?php else :?>订单已取消<?php endif;?>" target="ajaxTodo" href="<?php echo U('Order/cancel',array('id'=>$vo['id']));?>" <?php if($vo['status']!=-10) : ?>class="btnDel"<?php else :?>class="btnqx"<?php endif;?>>取消</a>
					<?php endif;?>
					<a href="<?php echo U('Order/o2ofee',array('id'=>$vo['id']));?>" title="<?php echo ($vo['sn']); ?> 订单结算" target="dialog" width="800" height="650" rel="Order_o2ofee_<?php echo ($vo['id']); ?>" class="btnLook">订单结算</a>
				</td>
			</tr><?php endforeach; endif; else: echo "" ;endif; ?>
<?php endif;?>
		</tbody>
	</table>
	</div>
<div class="panelBar">
	<div class="pages">
		<span>显示</span>
		<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
			<option value="20" <?php if($numPerPage==20) : ?>selected="selected"<?php endif;?>>20</option>
			<option value="50" <?php if($numPerPage==50) : ?>selected="selected"<?php endif;?>>50</option>
			<option value="66" <?php if($numPerPage==66) : ?>selected="selected"<?php endif;?>>66</option>
			<option value="100" <?php if($numPerPage==100) : ?>selected="selected"<?php endif;?>>100</option>
			<option value="200" <?php if($numPerPage==200) : ?>selected="selected"<?php endif;?>>200</option>
			<option value="500" <?php if($numPerPage==500) : ?>selected="selected"<?php endif;?>>500</option>
		</select>
		<span>条，共<?php echo ($totalCount); ?>条</span>
	</div>
	
	<div class="pagination" targetType="navTab" totalCount="<?php echo ($totalCount); ?>" numPerPage="<?php echo ($numPerPage); ?>" pageNumShown="10" currentPage="<?php echo ($pageNum); ?>"></div>
</div>
</div>